from queue import Queue
from time import sleep, time

import start, _record, _cmd


TIMEOUT = 15

def get_report(app, q):
    while start.flag_run:
        try:
            objReport = q.get(timeout=TIMEOUT)
        except:
            # app.logger.info("info: each_down %ss break" % TIMEOUT)
            continue

        sleep(10)
        print("version=%s" % objReport.version)
        
        _record.close(objReport.timestamp, objReport.w3name, _cmd.CMD_APR_REPORT)

